
class Admin::AddressesController < Admin::BaseController

  def edit
    @address = Address.find params[:id]
    @order_id = params[:order_id]
  end

  def update
    order_id = params[:order_id]

    @address = Address.find params[:id]
    @address.attributes = params.require(:address).permit!
    
    if @address.save
      flash[:notice] = "修改品牌成功"
      redirect_to admin_order_path(order_id)
    else
      render action: :edit
    end
  end

end
